<!DOCTYPE html>
<!-- 邮箱验证码 -->
<!-- document.getElementById("myForm").submit(); -->
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function checkForm() {
		debugger;
		var email = document.getElementById("email").value;
		if (email == undefined) {
			alert("请输入邮箱地址");
		}
		var pass = document.getElementById("pass").value;
		if (pass.length < 6 || pass.length > 18) {
			alert("请输入6~18位密码");
		}
		var passagr = document.getElementById("passOne").value;
		if (passagr !== pass) {
			alert("与第一次密码不符，请重新输入");
		}
		var verification = document.getElementById("verification").value;
		if (!verification) {
			alert("验证码不能为空");
		}
		
	}
</script>
</head>
<body>
	<form action="http://www.baidu.com" id="myForm">
		    邮箱地址：<input type="text" name="email" id="email" size="20">@<input
			type="text"><br /> <br> 
		密码：<input type="password" name="pass" size="20" id="pass"><br /> <br> 
			再次输入密码：<input type="password" name="passagr" id="passOne" size="20"><br /> <br>
		     验证码：<input type="text" name="verification" id="verification" size="20"><br />
		<br> <input type="button" value="提交" onclick="checkForm()">
		<input type="reset" value="重置">
	</form>
</body>
</html>